<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>


    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#test1").click(function () {

                var id = 100;
                var title = 'shenzhen';
                var _list = [];
                for (var i = 0; i < 10; i++) {
                    _list[i] = i;
                }

                var jsonData = {
                    "id": 100,
                    "title": "title"
                };
                alert(jsonData);
                $.ajax({
                    type: 'get',
                    url: 'http://localhost:10088/JFinal/indexParams',
                    data: {
                        id: id,
                        title: title,
                        list: _list
                        //	jsonData : JSON.stringify(jsonData)
                    },

                    contentType: "application/json;charset=utf-8",
                    dataType: 'json',

                    success: function (result) {
                        alert(result.name);
                    },
                    error: function (result) {
                        alert('error');
                    }
                });
            });

            $("#test2").click(function () {

                var id = 100;
                var title = 'shenzhen';
                var _list = [];
                for (var i = 0; i < 10; i++) {
                    _list[i] = i;
                }

                var jsonData = {
                    "id": 100,
                    "title": "title"
                };
                alert(jsonData);
                $.ajax({
                    type: 'get',
                    url: 'http://localhost:8899/index/indexs',
                    data: {
                        //	id : id,
                        //	title : title,
                        //	list : _list,
                        jsonData: JSON.stringify(jsonData)
                    },

                    contentType: "application/json;charset=utf-8",
                    dataType: 'json',

                    success: function (result) {
                        alert(result.name);
                    },
                    error: function (result) {
                        alert('error');
                    }
                });
            });

        });
    </script>
</head>

<body>

<button id="test1">JFinal</button>

<button id="test2">springboot</button>

Yan index.jsp
</html>

